#!/usr/bin/python

import os
import argparse

pssh = 'pssh-run'
cmd = '"cd research/pytopic; pypy scripts/kdd13/{0}.py"'
name = '{0}{1}'
potatoes = '/config/potatoes/all3'
run = ' '.join([pssh, cmd, name, potatoes])

parser = argparse.ArgumentParser()
parser.add_argument('pssh_runs', type=int, default=1, nargs='?')
pssh_runs = parser.parse_args().pssh_runs

for i in range(pssh_runs):
    os.system(run.format('delicious', i))
    os.system(run.format('newsgroups', i))
    os.system(run.format('enron', i))
    os.system(run.format('reuters', i))
    os.system(run.format('webkb', i))
